Embodiments of the present invention relate to communication networks, and more particularly, to an apparatus and method for efficiently providing header checksums for data packets.
FIG. 1 abstracts a communication network, in which node A 102 communicates with node B 104 by sending and receiving data frames. Node A sends a data frame to node B by sending a data frame to router 110 via physical network 106, whereupon router 110 routes the data frame to node B via physical network 108. For simplicity, FIG. 1 illustrates only two nodes and one router communicating via two physical networks, but in practice, an Internet comprises many physical networks, routers, nodes, switches, and other devices. Nodes A and B may be, for example, computers, routers, or other types of processors.
The layered concept of communication is illustrated in FIG. 1, where layers 102a, 102t, 102i, and 102n provide, respectively, application, transport, internet, and network interface functions for node A; layers 104a, 104t, 104i, and 104n provide, respectively, application, transport, internet, and network interface functions for node B; and layers 110i and 110n provide, respectively, internet and network interface functions for router 110. The network interface layer may comprise a data link layer and a PHY layer. The transport layer may implement TCP (Transmission Control Protocol) and the Internet layer may implement IP (Internet Protocol). Various layers, or portions of the layers, may be implemented in hardware or software.
Application layers 102a and 104a are software layers running application programs that may be the source or destination of transmitted data. The transport, internet, and network interface layers pass packets between them. The layered concept employs encapsulation. The transport layer receives data from the application layer, and creates a packet, sometimes called a transport protocol packet. The internet layer encapsulates the transport protocol packet into a larger packet, sometimes called an IP datagram (assuming the internet layer employs IP). The network interface layer encapsulates the IP datagram into a network-specific packet, sometimes called a frame, for transmission over a physical network. See, for example, Internetworking with TCP/IP, Douglas E. Corner, Prentice Hall, for a more detailed discussion of communication networks and the layered concept. For simplicity, frames and datagrams may be referred to as simply packets.
A simplified illustration of a packet is given in FIG. 2. Packet 202 comprises payload 204 and header 206. Header 206 usually comprises a number of fields, but for simplicity, only checksum field 208 is shown in FIG. 2. A checksum is an integer value, usually computed from a sequence of octets by treating them as integers and computing their sum. Many TCP/IP protocols use a 16-bit checksum computed by one""s complement arithmetic. A header checksum may sum over all octets in a header, some of the octets, or all the octets plus additional octets outside the header field. A checksum is used to detect errors. Upon reception of a packet, a checksum on the received packet is performed and compared with the received value of the checksum. If the received and computed checksums do not match, then an error may be indicated.
Checksums are ubiquitous in data packet communications, and efficiently computing checksums is of practical utility and interest.